package edu.ju.smcc.applet;

import java.applet.Applet;
import java.awt.*;

/*
 <applet code="ap1" width="500" height="400">
 </applet>
 */

public class AppletLifeCycle extends Applet {
	public AppletLifeCycle() {
		System.out.println("i am cons...");
	}

	static {
		System.out.println("i am static block...");
	}
	{
		System.out.println("i am instance block...");
	}

	String z = "";
	Font f;

	public void init() {
		setBackground(Color.red);
		setForeground(Color.yellow);
		f = new Font("Times New Roman", Font.BOLD, 18);
		z = "amitava";
	}

	public void start() {
		z += "teaches...";
	}

	public void paint(Graphics g) {
		z += "JAVA";
		g.setFont(f);
		g.drawString(z, 60, 120);
	}

	public void stop() {
		System.out.println("stopped....");
	}

	public void destroy() {
		System.out.println("bye bye....");
	}

	public static void main(String t[]) {
		System.out.println("i am main...");
		// AppletLifiCycle x=new AppletLifiCycle();
	}
}